#include <QWidget>
#include <string>
#include <vector>

#ifndef _eLT
#define _eLT
enum eLT{eNone,eThr1,eThr2,eToT};
#endif

class QLCDNumber;
class QwtPlot;
class QwtPlotCurve;
class QwtPlotCurve;
class QwtWheel;
class QSlider;
class QString;
class QString;
class QTreeWidget;
class QTreeWidgetItem;
class QCheckBox;

class pmtTrace;
class see;
class tCandidate;
class tStation;
class tEventsummary;

using namespace std;

class qTrace: public QWidget
{
  Q_OBJECT
      
  public:
    qTrace(QWidget *parent = 0);
    qTrace(pmtTrace* trace,QWidget *parent = 0);
    ~qTrace();
    
  public slots:
    void setValue(pmtTrace* trace);
    void rescaleHPlot(int scale);
    void rescaleVPlot(int scale);
    void movePlot(double shift);
    
  private:
    QwtPlot *tracePlot[3];
    QwtPlotCurve *totalVEM[3];
    QwtWheel *ruedita;
    QSlider *zoomH;
    QSlider *zoomV;

    double maxVem;
    double xMax;
    double xMin;
    double range;
    double limInf;
    double limSup;
};

class qTankList: public QWidget
{
  Q_OBJECT
  
  public:
    qTankList(QWidget *parent = 0);
    qTankList(vector<tCandidate>* statList,QWidget *parent = 0);
    int getTankIndex(int sId);
    
  signals:
    void externalTankSelect(int sId,eLT lt,int sIndex);

  public slots:
    void setTankList(vector<tCandidate>* statList);
    void tankSelect(int sId);
    
  private slots:
    void itemSelectionChanged();
    
  private:
    QTreeWidget *treeWidget;
    vector<tCandidate>* candList_pointer;
    vector<int> indice;
    vector<int> sorted_sId;
    vector<int> sorted_ns;
    bool externalSelection;
    vector<QTreeWidgetItem*> treeItems;
};

class qEventsList: public QWidget
{
  Q_OBJECT
  
  public:
    qEventsList(QWidget *parent = 0);
    qEventsList(vector<tEventsummary> *eventsList,QWidget *parent = 0);
    
  signals:
    void eventSelected(int eventIndexNo);

  public slots:
    void setEventsList(vector<tEventsummary> *eventsList);
    
  private slots:
    void itemSelectionChanged();
    
  private:
    QTreeWidget *treeWidget;
    vector<QTreeWidgetItem*> treeItems;
    vector<tEventsummary> *eventsList_pointer;
    bool externalSelection;
    /*
    vector<int> indice;
    vector<int> sorted_sId;
    vector<int> sorted_ns;
    */
};



